% textbox.m - make a textbox with a label
% call: textbox(tag, label, initvalue, x, y)
% x and y are in character units...
function [handle] = textbox(tag, label, value, fieldwidth, x, y)

b_ht = 1.4; % standard field height in characters
pad_text=4;

if(~isempty(value))
    display_text = char(sprintf('%12s : %-8.3f', label, number_arg(value)));
else
    display_text = char(sprintf('%21s', label));
end


fw = 21; % length(display_text)+pad_text;

h1 = uicontrol('Units','characters', ...
	'ListboxTop',0, ...
   'Position',[x y fw b_ht], ...
   'HorizontalAlignment','left', ...
   'String',display_text, ...
	'Style','text', ...
    'FontName', 'Arial', ...
    'FontSize', 8);
%set(handle, 'String', initvalue);
return

